const express = require('express')
const router = express.Router()
const config = require('../config');
const expressJWT = require('express-jwt');

const userinfo_handler = require('../router_handler/userInfo')
//获取用户基本信息
router.get('/userinfo', expressJWT({ secret: config.jwtSecretKey }), userinfo_handler.getUserInfo)
//更新用户基本信息
router.post('/updateinfo', expressJWT({ secret: config.jwtSecretKey }), userinfo_handler.updateUserInfo)
//重置用户密码
router.post('/updatepwd', expressJWT({ secret: config.jwtSecretKey }), userinfo_handler.updatepwd)
//更换用户头像
router.post('/update/avatar', expressJWT({ secret: config.jwtSecretKey }), userinfo_handler.updateAvatar)
//发布动态
router.post('/releaseDynamic', expressJWT({ secret: config.jwtSecretKey }), userinfo_handler.releaseDynamic)
//获取自己发布的动态信息
router.get('/getDynamicInfoByown', expressJWT({ secret: config.jwtSecretKey }), userinfo_handler.getDynamicInfoByown)
//获取发布的动态信息
router.get('/getDynamicInfoList', userinfo_handler.getDynamicInfoList)
module.exports = router